package com.ruoyi.service.impl;

import java.util.List;

import com.ruoyi.mapper.ZhwyShopsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.ZhwyDowntownMapper;
import com.ruoyi.domain.ZhwyDowntown;
import com.ruoyi.service.IZhwyDowntownService;

/**
 * 商业区信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-07
 */
@Service
public class ZhwyDowntownServiceImpl implements IZhwyDowntownService 
{
    @Autowired
    private ZhwyDowntownMapper zhwyDowntownMapper;

    @Autowired
    private ZhwyShopsMapper zhwyShopsMapper;

    /**
     * 查询商业区信息
     * 
     * @param id 商业区信息主键
     * @return 商业区信息
     */
    @Override
    public ZhwyDowntown selectZhwyDowntownById(Long id)
    {
        return zhwyDowntownMapper.selectZhwyDowntownById(id);
    }

    /**
     * 查询商业区信息列表
     * 
     * @param zhwyDowntown 商业区信息
     * @return 商业区信息
     */
    @Override
    public List<ZhwyDowntown> selectZhwyDowntownList(ZhwyDowntown zhwyDowntown)
    {
        return zhwyDowntownMapper.selectZhwyDowntownList(zhwyDowntown);
    }

    /**
     * 新增商业区信息
     * 
     * @param zhwyDowntown 商业区信息
     * @return 结果
     */
    @Override
    public int insertZhwyDowntown(ZhwyDowntown zhwyDowntown)
    {
        return zhwyDowntownMapper.insertZhwyDowntown(zhwyDowntown);
    }

    /**
     * 修改商业区信息
     * 
     * @param zhwyDowntown 商业区信息
     * @return 结果
     */
    @Override
    public int updateZhwyDowntown(ZhwyDowntown zhwyDowntown)
    {
        return zhwyDowntownMapper.updateZhwyDowntown(zhwyDowntown);
    }

    /**
     * 批量删除商业区信息
     * 
     * @param ids 需要删除的商业区信息主键
     * @return 结果
     */
    @Override
    public int deleteZhwyDowntownByIds(Long[] ids)
    {
        return zhwyDowntownMapper.deleteZhwyDowntownByIds(ids);
    }

    /**
     * 删除商业区信息信息
     * 
     * @param id 商业区信息主键
     * @return 结果
     */
    @Override
    public int deleteZhwyDowntownById(Long id)
    {
        return zhwyDowntownMapper.deleteZhwyDowntownById(id);
    }

    @Override
    public List<ZhwyDowntown> selectList() {
        Long[] ds = zhwyShopsMapper.getDid();
        List<ZhwyDowntown> list = zhwyDowntownMapper.selectList(ds);
        return list;
    }
}
